#pragma once


#include <memory>
#include "socketchannel.h"
#include "../inetaddress.h"
#include "AbstractChannel.h"
#include "../eventloop.h"
namespace TinyRPC{

// 服务端socketchannel
class ServerSocketChannel : public AbstractChannel{
public:
    static ServerSocketChannel CreateAndBind(INetAddress & address);
    SocketChannelPtr accept();
    int listen();
private:
    ServerSocketChannel(int fd, INetAddress & address);
private:
    INetAddress m_localAddress;
};

using ServerSocketChannelPtr = std::shared_ptr<ServerSocketChannel>;
}
